package other.example;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JList;
import java.awt.Color;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.SystemColor;
import javax.swing.AbstractListModel;

public class DataSourceFrame extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					DataSourceFrame frame = new DataSourceFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public DataSourceFrame() {
		setBackground(Color.BLACK);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 375, 557);
		contentPane = new JPanel();
		contentPane.setBackground(Color.BLACK);
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JList list = new JList();
		list.setModel(new AbstractListModel() {
			String[] values = new String[] {"system_localhost", "sqlServer_mmall"};
			public int getSize() {
				return values.length;
			}
			public Object getElementAt(int index) {
				return values[index];
			}
		});
		list.setBackground(SystemColor.menu);
		list.setBounds(0, 0, 357, 316);
		contentPane.add(list);
		
		JPanel panel = new JPanel();
		panel.setBounds(0, 318, 357, 106);
		contentPane.add(panel);
		
		JButton myDatasourceButton = new JButton("\u81EA\u5B9A\u4E49\u6570\u636E\u6E90......");
		myDatasourceButton.setBackground(SystemColor.activeCaption);
		myDatasourceButton.setBounds(14, 44, 160, 27);
		myDatasourceButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		panel.setLayout(null);
		panel.add(myDatasourceButton);
		
		JPanel panel_1 = new JPanel();
		panel_1.setBounds(0, 425, 357, 85);
		contentPane.add(panel_1);
		panel_1.setLayout(null);
		
		JButton okButton = new JButton("\u786E\u5B9A");
		okButton.setBounds(157, 45, 83, 27);
		panel_1.add(okButton);
		
		JButton button = new JButton("\u53D6\u6D88");
		button.setBounds(260, 45, 83, 27);
		panel_1.add(button);
	}
}
